#define _CRT_SECURE_NO_WARNINGS 1

#include "Stack.h"

void TestStack1()
{
	ST ps;
	StackInit(&ps);

	StackPush(&ps, 1);
	StackPush(&ps, 2);
	StackPush(&ps, 3);
	StackPush(&ps, 4);
	StackPush(&ps, 5);
	StackPush(&ps, 6);

	StackPop(&ps);
	StackPop(&ps);

	StackDestroy(&ps);
}

void TestStack2()
{
	ST ps;
	StackInit(&ps);

	StackPush(&ps, 1);
	StackPush(&ps, 2);
	StackPush(&ps, 3);
	printf("%d\n", StackTop(&ps));

	StackPop(&ps);
	printf("%d\n", StackTop(&ps));

	StackDestroy(&ps);
}

void TestStack3()
{
	ST ps;
	StackInit(&ps);

	StackPush(&ps, 1);
	StackPush(&ps, 2);
	StackPush(&ps, 3);

	while (!StackEmpty(&ps))
	{
		printf("%d  ", StackTop(&ps));
		StackPop(&ps);
	}
}

int main()
{
	//TestStack1();
	//TestStack2();
	TestStack3();
	return 0;
}